/**
 * @addtogroup FXGE
 * @{
 */

/**
 * @file
 * @brief Platform independant support.
 */
/** @brief Opengl es device class. */
#ifndef _FX_GE_OPENGLES_H_		
#define _FX_GE_OPENGLES_H_

class CFX_OpenGlesDevice : public CFX_RenderDevice
{
public:
	/** Constructor. */
	CFX_OpenGlesDevice();
	/** The destructor. */
	~CFX_OpenGlesDevice();
	/**
	 * Attach to an existing bitmap.
	 *
	 * @param[in] pBitmap		The bitmap to be attached.
	 * @param[in] dither_bits	The optional dithering bits. 0 for no dithering
	 * @param[in] bRgbByteOrder A RGB byte-order buffer or a BGR byte-order buffer.
	 * @param[in] bGroupKnockout If the Object rendering knockout. 
	 * @param[in] pOriDevice    The background of device.
	 */
	FX_BOOL			Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);

	/**
	 * Create a new bitmap and attach to this device. 
	 * The bitmap will be destroyed when the device destructs.
	 *
	 * @param[in] width			The bitmap width.
	 * @param[in] height		The bitmap height.
	 * @param[in] format		The bitmap format.
	 * @param[in] dither_bits	Number of bits per pixel for destination dithering. 
								For example, for a 4-gray scale EPD destination display, this should be 2.
								0 for no dithering used.
	 * @return FALSE if creation failed (OOM), or TRUE if success.
	 */
	FX_BOOL			Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);

	FX_BOOL         Attach(EGLNativeWindowType pWindowHandle);
protected:
	/** Whether the device manager the bitmap memory. */
	FX_BOOL			m_bOwnedBitmap;	
};
#endif //_FX_GE_OPENGLES_H_